package com.gaga.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gaga.mapper.SysUserMapper;
import com.gaga.pojo.SysUser;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements UserService{

    @Resource
    private SysUserMapper sysUserMapper;

    @Override
    public SysUser login(String usrName, String usrPassword) {
        return sysUserMapper.getLoginUser(usrName);
    }

    @Override
    public void addUser(SysUser sysUser) {
        sysUserMapper.insert(sysUser);
    }

    @Override
    public int deleteUser(Long usrId) {
        return 0;
    }

    @Override
    public int updateUser(SysUser sysUser) {
        return 0;
    }

    @Override
    public SysUser getUser(Long usrId) {
        return sysUserMapper.selectById(usrId);
    }

    @Override
    public List<SysUser> findAllUsers() {
        return sysUserMapper.findAllUsers();
    }
}
